package com.qnkf.config;

import com.qnkf.service.BaseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Calendar;

/**
 * 定时任务
 *
 * @author: ZRH
 * @CreateDate: 2019/6/17 15:26
 */
@Slf4j
@Component
@EnableScheduling
public class ScheduledTask extends BaseService {


    /**
     * 修改活动状态值
     */
    @Async("asyncServiceExecutor")
    protected void updateActivityState() {
        System.out.println("qingniankuangfeng");
    }

//    @Scheduled(cron = "0 0 0/1 * * ?")
    @Scheduled(cron = "0 0/1 * * * ?")
    public void hourImplement() {
        log.info("每分钟执行一次");
        updateActivityState();
    }


}
